package com.hangxintong.service;

import com.hangxintong.common.base.dto.HeaderDto;
import com.hangxintong.common.base.entity.LmUser;
import com.hangxintong.common.config.HeaderHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Slf4j
@Service
public class MsgLoginService {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Resource
    private HeaderHolder headerHolder;
    /**
    * @Description
    * @Author  Bz.Mr
    * @Date   2021/1/18 16:05
    * 用户登录后更新MemberCompany表
    */
    public void updateMemberCompanyService() {
        LmUser user = headerHolder.getHeader().getUser();
        rabbitTemplate.convertAndSend("hxtMessage","hxtMember.updateMemberCompany", user);
    }
}
